package com.yorick.account.controller;

import com.yorick.account.modal.request.AccountAddRequest;
import com.yorick.account.service.RegisterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("register")
public class RegisterController {
    @Autowired
    RegisterService registerService;

    @PostMapping(value = "doRegister")
    public Map<String, Object> doRegister(@RequestBody AccountAddRequest requestBody){
        return registerService.addAccount(requestBody);
    }
}
